<template>
  <div class="containers">
       <x-textarea :max="200" placeholder="尽情吐槽吧" :height="250" class="text" v-model="content"></x-textarea>
       <div class="btn" @click="sub">提交</div>
       <toast v-model="show5" :time="500">{{toastText}}</toast>
  </div>
</template>
<script>
import { XTextarea ,Toast} from 'vux'
import axios from '@/api/request'
export default {
   components: {
    XTextarea,Toast
  },
  data () {
	    return {
            content:'',
            toastText:"提交成功",
            show5:false
        }
     },
  methods:{
      sub(){
          var self=this
          let data={
              userId:self.$route.query.userId,
              content:self.content
          }
           axios('/device/feedback/add','post',data).then((res) => {
                self.show5=true;
                if(res.data.code!="1000"){
                     self.toastText="提交失败"
                 }else{
                      setTimeout(function(){
                    self.$router.push({ path:'/personCenter', query: { userId: self.$route.query.userId }})
                 },100)
                 }
                
                
                
          })
      }
  }
}
</script>

<style lang="less" scoped>
  .containers{
      height: 100%;
      width: 100%;
      background: #f6f6f6;
      box-sizing: border-box;
      padding: 22px;
      .text{
          padding:20px 20px;
          font-size: 16px;
          background: #fff;
      }
      .btn{
          height: 0.98rem;
          line-height:0.98rem;
          text-align: center;
          font-size: 0.426667rem;
          background: #feba4e;
          color: #fff;
          border-radius: 50px;
          width:80%;
          margin: 65px auto;
     }
  }
</style>
